<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>3d立方体</title>
    <style type="text/css">
        #box {
            width: 400px;
            height: 400px;
            /* border: 2px solid black; */
            font-size: 200px;
            text-align: center;
            line-height: 400px;
            /* transform: rotateX(-5deg) rotateY(-5deg); */
            transition: transform 20s cubic-bezier(.1, .3, .9, 1);
            transform-style: preserve-3d;
            position: relative;
            left: 400px;
            top: 300px;
            animation: beat 18s infinite alternate;
            /* backface-visibility: hidden; */
            transform-origin: center center 150px;
        }
        
        @keyframes beat {
            0% {
                transform: rotateX(0deg) rotateY(0deg);
            }
            25% {
                transform: rotateX(135deg) rotateY(630deg) rotateZ(135deg);
            }
            50% {
                transform: rotateX(90deg) rotateY(1080deg);
            }
            75% {
                transform: rotateZ(45deg) rotateY(1530deg);
            }
            100% {
                transform: rotateX(180deg) rotateZ(-90deg) rotateY(1980deg);
            }
        }
        /* @keyframes beat {
            from {
                transform: rotateX(-5deg) rotateY(0deg);
            }
            to {
                transform: rotateX(30deg) rotateY(1800deg);
            }
        } */
        /* #box:hover {
            transform: rotateX(-5deg) rotateY(1800deg) scale3d(2, 2, 2);
        } */
        
        #box .face {
            width: 400px;
            height: 400px;
            position: absolute;
            left: 0;
            top: 0;
            transition: ease-in-out 2s;
            opacity: 0.7;
        }
        
        #box>div:nth-last-of-type(1) {
            background: url(./image/曾沛慈4.png) no-repeat center/400px 400px;
        }
        
        #box>div:nth-last-of-type(2) {
            background: url(./image/曾沛慈2.png) no-repeat center/400px 400px;
        }
        
        #box>div:nth-last-of-type(3) {
            background: url(./image/曾沛慈3.png) no-repeat center/400px 400px;
        }
        
        #box>div:nth-last-of-type(4) {
            background: url(./image/曾沛慈1.png) no-repeat center/400px 400px;
        }
        
        #box>div:nth-last-of-type(5) {
            background: url(./image/曾沛慈5.png) no-repeat center/400px 400px;
        }
        
        #box>div:nth-last-of-type(6) {
            background: url(./image/曾沛慈6.png) no-repeat center/400px 400px;
        }
    </style>
</head>

</html>



<body style="margin: 0">
    <div id="box">
        <div class="face" style="transform: translateZ(200px)"> </div>
        <div class="face" style="transform: translateY(200px) rotateX(-90deg);"> </div>
        <div class="face" style="transform: translateY(-200px) rotateX(90deg);"> </div>
        <div class="face" style="transform: translateX(-200px) rotateY(90deg);"> </div>
        <div class="face" style="transform: translatex(200px) rotateY(-90deg);"> </div>
        <div class="face" style="transform: translateZ(-200px) "> </div>
    </div>
</body>

</html>